//
//  DataBaseHandler.h
//  EagleEye
//
//  Created by 18_李明明 on 15-1-28.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>
@interface DataBaseHandler : NSObject
{
    // 数据库指针，指向本地的数据库文件
    sqlite3 *dbpoint;
}
// 创建单例
+ (DataBaseHandler *)shareInstance;
// 打开数据库
- (BOOL)openDB;
// 关闭数据库
- (BOOL)closeDB;





// 创建表 插入数据
// 二维码
- (BOOL)createQR;
- (BOOL)insertQR:(NSString *)content;
// 快递
- (BOOL)createExpress;
- (BOOL)insertExpress:(NSString *)number Company:(NSString *)company pinyin:(NSString *)pinyin;
// 公交
- (BOOL)createBusOfLine;
- (BOOL)insertBusOfLine:(NSString *)line city:(NSString *)city combine:(NSString *)combine;
- (BOOL)createBusOfChange;
- (BOOL)insertBusOfFrom:(NSString *)from to:(NSString *)to city:(NSString *)city combine:(NSString *)combine;
- (BOOL)createBusOfStation;
- (BOOL)insertBusOfStation:(NSString *)station city:(NSString *)city combine:(NSString *)combine;
// 火车
- (BOOL)createTrainOfLine;
- (BOOL)insertTrainOfLine:(NSString *)line;
- (BOOL)createTrainOfChange;
- (BOOL)insertTrainOfFrom:(NSString *)from to:(NSString *)to combine:(NSString *)combine;
// 手机
- (BOOL)createPhone;
- (BOOL)insertPhone:(NSString *)phone;

// 删除
- (BOOL)deleteQRWithContent:(NSString *)content;
- (BOOL)deleteExpressWithNumber:(NSString *)number;
- (BOOL)deleteBusOfLine:(NSString *)combine;
- (BOOL)deleteBusOfFromAndTo:(NSString *)combine;
- (BOOL)deleteBusOfStation:(NSString *)combine;
- (BOOL)deleteTrainOfLine:(NSString *)line;
- (BOOL)deleteTrainOfStation:(NSString *)combine;
- (BOOL)deletePhone:(NSString *)phone;

// 查询
- (NSMutableArray *)selectQR;
- (NSMutableArray *)selectExpress;
- (NSMutableArray *)selectBusOfLine;
- (NSMutableArray *)selectBusOfChange;
- (NSMutableArray *)selectBusOfStation;
- (NSMutableArray *)selectTrainOfLine;
- (NSMutableArray *)selectTrainOfChange;
- (NSMutableArray *)selectPhone;


@end
